add jar hdfs:///StarRocks/jars/starrocks-spark2_2.11-1.0.0.jar;
CREATE TEMPORARY VIEW  dwm_sign_warning_detail_view
USING starrocks
OPTIONS
(
    "starrocks.table.identifier" = "jms_dwm.dwm_sign_warning_detail",
    "starrocks.fenodes" = "pro-time-dorisdb-31.bigdata.yl.com:8030",
    "user" = "dbadmin",
    "password" = "sn4TqJT78ZoW",
    "starrocks.batch.size" = "10000",
    "starrocks.exec.mem.limit" = "61474836480",
    "starrocks.request.tablet.size" = "6",
    "starrocks.filter.query" = "planned_sign_time >= date_add('{{ execution_date | cst_ds }}',-7) and planned_sign_time <= date_add('{{ execution_date | cst_ds }}',1) ",
    "starrocks.request.read.timeout.ms" = "300000"
);
insert overwrite table jms_dwd.dwm_sign_warning_detail_dt partition (dt)
select
planned_sign_date,
network_code,
waybill_no,
bulk_cargo_shift,
sign_type,
is_sign,
sign_ontime,
sign_delay,
planned_sign_time,
send_scan_time,
arrival_scan_time,
deliver_scan_time,
sign_scan_time,
send_deliver_user,
send_deliver_usercode,
township_name,
township_id,
agent_area_name,
agent_area_code,
franchisee_name,
franchisee_code,
network_name,
network_id,
center_entrepot_name,
center_entrepot_code,
order_source_name,
order_source_code,
goods_type_name,
goods_type_code,
receiver_detailed_address,
pick_network_code,
source,
is_problem,
second_level_type_code,
second_level_type_name,
problem_scan_time,
township_overtime,
terminal_dispatch_code,
waybill_township_id,
date_format(planned_sign_time,'yyyy-MM-dd') as dt
from dwm_sign_warning_detail_view
distribute by dt,pmod(hash(rand()),56)
;
